package dshop.model.push;

import java.util.List;

import com.jfinal.plugin.activerecord.Db;

import appbase.jfinal.ext.BaseModel;

public class PushNum extends BaseModel<PushNum> {

	private static final long serialVersionUID = -6967680902549117464L;

	public static final PushNum dao = new PushNum();

	public static void minusNum(List<Integer> userIdList) {
		if (userIdList == null || userIdList.isEmpty()) {
			return;
		}

		String sql = " update push_num set num = num - 1 where userId in (??) ";
		sql = dao.buildSqlHasIn(sql, userIdList);
		Db.update(sql);
	}

	public static void plusNum(List<Integer> userIdList) {
		if (userIdList == null || userIdList.isEmpty()) {
			return;
		}

		String sql = " update push_num set num = num + 1 where userId in (??) ";
		sql = dao.buildSqlHasIn(sql, userIdList);
		Db.update(sql);
	}

}
